package org.example.demo3.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.example.demo3.enity.VerificationCode;
import java.util.Optional;

@Mapper
public interface VerificationCodeMapper {
    // 插入新验证码
    int insert(VerificationCode verificationCode);
    
    // 根据用户名和类型查找最新的有效验证码
    Optional<VerificationCode> findLatestByUsernameAndType(String username, String type);
    
    // 更新验证码状态
    int updateStatus(Long id, Integer status);
} 